Skip to content

title_window, xgameruntime_offline: skip what needs a desktop when there is no interactive window station - #2139

Open
qhukz13 wants to merge 1 commit into
ProjectLeonida:mainfrom
qhukz13:cont/tests-session0-skip
Open

qhukz13 wants to merge 1 commit into
ProjectLeonida:mainfrom
qhukz13:cont/tests-session0-skip

Conversation

@qhukz13

@qhukz13 qhukz13 commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

Item: TEST-SESSION0-DESKTOP-SKIP

Problem

Run over OpenSSH or as a service, a process lives in session 0, whose window station is not interactive. Two runtime tests fail there for reasons that are not runtime bugs:

  • title_window: no window is ever visible, so find_title_window has nothing to pick and the test stops at title_window_test.cpp:85 (found == windows.title).
  • xgameruntime_offline and xgameruntime_offline_hdr: PowerSetRequest(PowerRequestDisplayRequired) answers ERROR_NOT_SUPPORTED (50) in session 0, so XDisplayAcquireTimeoutDeferral acquires a display power request handle and concurrent display deferrals have distinct handles fail. The system and away-mode requests do work there (measured with a small PowerShell probe of the same calls over SSH).

From a desktop session all three pass. #1217 already notes the SSH difference for xgameruntime_offline.

Change

  • title_window_test: returns 77 (SKIP, with a line saying why) when has_interactive_window_station() is false; SKIP_RETURN_CODE 77 on the test.
  • xgameruntime_offline_test: when the first acquire answers HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED) and there is no interactive window station, it checks that no handle was left and prints a SKIP line for the two handle checks; everywhere else they are checked as before. The rest of the test is unchanged.
  • Both use runtime/test/window_station.h's has_interactive_window_station() (the WSF_VISIBLE flag), as the DXGI and present tests already do. No runtime change.

Testing

Windows 10 Pro 19045, GTX 1050 Ti, NVIDIA 582.66, MSVC RelWithDebInfo, base 5fab93967, 3 runs each way:

  • Over OpenSSH (session 0): title_window Skipped, xgameruntime_offline and xgameruntime_offline_hdr pass (on main all three fail there).
  • In an RDP desktop session on the same machine: all three pass with every check run.
  • python -I scripts/check_no_game_data.py on the changed files: clean.

AI-assisted (Claude Code, Opus 5.5).

🤖 Generated with Claude Code

…ere is no interactive window station

Over OpenSSH or as a service (session 0) the process's window station is
not interactive: no window is visible there, so find_title_window has
nothing to pick, and PowerSetRequest(PowerRequestDisplayRequired) answers
ERROR_NOT_SUPPORTED, so XDisplayAcquireTimeoutDeferral fails (measured on
Windows 10 19045 over SSH; the system and away-mode requests work there).
From a desktop session both tests pass (measured in an RDP session on the
same machine). title_window returns 77 (SKIP) without an interactive
station; xgameruntime_offline skips only its two display-deferral checks,
and only when the request is refused with ERROR_NOT_SUPPORTED there.
Both use window_station.h's has_interactive_window_station(), as the DXGI
tests do. ProjectLeonida#1217 documents the SSH difference.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@zmasi

zmasi commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

Verified on Windows 11 (10.0.26200.9974) with MSVC 19.44.35228 (x64, /std:c++20 /EHsc /W4 /permissive- /utf-8 /O2) against main d48a957bb + dd47f60c4f (claim #2570#issuecomment-7239425776):

  • Line-by-line diff audit: Clean (runtime/CMakeLists.txt, runtime/test/title_window_test.cpp, runtime/test/xgameruntime_offline_test.cpp); wires SKIP_RETURN_CODE 77 + has_interactive_window_station() in title_window_test and skips only the display power-request handle assertions in xgameruntime_offline_test when XDisplayAcquireTimeoutDeferral returns HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED) without an interactive window station. check_no_game_data.py clean.
  • Red (d48a957bb in a real non-interactive Win32 HWINSTA via CreateWindowStationW(nullptr, ...) where WSF_VISIBLE == 0): title_window_test.exe fails (rc=1, line 85: found == windows.title).
  • Green (d48a957bb + dd47f60c4f merge): Auto-merges cleanly (rc=0), compiles both title_window_test.exe and xgameruntime_offline_test.exe with 0 warnings under /W4 /permissive-, passes on the interactive desktop (title_window: ok rc=0, xgameruntime_offline_test: 74 checks, 0 failures rc=0), and inside a non-interactive HWINSTA cleanly exits 77 (title_window_test.exe) and 0 (xgameruntime_offline_test.exe).
  • Minor non-blocking nit: window_station.h calls GetProcessWindowStation / GetUserObjectInformationW (user32.dll); CMake's default Windows library list already links user32.lib, though adding user32 explicitly to target_link_libraries(xgameruntime_offline_test ...) would match title_window_test and d3d12_present_test.

AI-assisted.

@enlight3d

Copy link
Copy Markdown
Contributor

Run of #2139 (title_window, xgameruntime_offline, xgameruntime_offline_hdr), green on a desktop session; no red is reachable here.

  • PR head: dd47f60 (base 5fab939). Current main: 1bc055e. git merge-tree --write-tree main <head> merges cleanly.
  • GPU/driver: NVIDIA GeForce RTX 3090 24 GB, driver 621.40 (not used by these CPU-only tests). OS: Windows 11 Pro 10.0.26300, interactive desktop session (session 1). MSVC 19.44, Ninja, RelWithDebInfo.
  • Only the test targets were built, not the whole runtime.

Commands (in a vcvars64 shell, build folder inside the worktree):

cmake -S runtime -B runtime/build -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DLEONIDA_REQUIRE_VULKAN=ON -DSDL3_DIR=<installed SDL3 3.4.20 static>/cmake
cmake --build runtime/build --target title_window_test xgameruntime_offline_test -j 8
ctest -R "^(title_window|xgameruntime_offline|xgameruntime_offline_hdr)$" --output-on-failure

Green (PR head): all 3 Passed (100%, 0.36 s).

Red: not reproducible on this machine. The PR changes only what happens when the process has no interactive window station (SSH, service, session 0), and this run is from a desktop session, where the PR's changes are all in test files and do not alter the outcome. With the PR's changes to the two test files and the CMake line reverted (base versions at 5fab939), the same ctest also passes 3 of 3. I could not make a session 0 process here (no sshd, not administrator; CreateWindowStation answers access denied), so the fixed failures (window not visible in title_window, ERROR_NOT_SUPPORTED from the display power request) were not observed.

Extra check of the skip wiring only (simulation, not a real session 0): with has_interactive_window_station() temporarily forced to return false at the PR head, title_window ends ***Skipped (return code 77 through SKIP_RETURN_CODE), the suite still reports 100% passed, and the two xgameruntime tests still pass because the display request is granted on a desktop. This was reverted afterwards.
Link check: merged into main 1bc055e, gta6rt.exe builds and links (RelWithDebInfo, MSVC 19.44); no new imports vs main.

@github-actions github-actions Bot added the needs rebase Conflicts with the base branch: rebase it on main label Nov 29, 2026
@OreoFR

OreoFR commented Nov 29, 2026

Copy link
Copy Markdown
Contributor

@qhukz13 this PR now conflicts with main (runtime/CMakeLists.txt). Could you merge main into your branch (no force-push needed)? It was verified before the conflict: #2139 (comment). If there's no update within 24 h, OreoFR may carry it in a new PR that keeps you as co-author (per the maintainers' plan). — OreoFR's agent (AI-assisted)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs rebase Conflicts with the base branch: rebase it on main

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants